# -*- coding: utf-8 -*-
# @Time    : 2022/1/11 17:10
# @Author  : 徐翊宸
# @Email   : xyc@163.com
# @File    : page_xtsz.py
# @Software: PyCharm
from selenium.webdriver.common.by import By
from selenium.webdriver.support.select import Select
from pages.base_page import BasePage

class XtszPage(BasePage):

    toux_locator = (By.CSS_SELECTOR, "body > div.navbar.navbar-inverse.navbar-fixed-top > div > div > div.nav-collapse.collapse > ul.nav.pull-right > li:nth-child(6) > a > img")
    xtsz_submit_locator = (By.LINK_TEXT, "系统设置")
    httx_locator = (By.CSS_SELECTOR, "body > div.container > div.tabbable > div > form > table > tbody > tr:nth-child(10) > td:nth-child(2) > input[type=text]")
    htqz_locator = (By.CSS_SELECTOR, "body > div.container > div.tabbable > div > form > table > tbody > tr:nth-child(11) > td:nth-child(2) > input")
    rwfp_locator = (By.CSS_SELECTOR, "body > div.container > div.tabbable > div > form > table > tbody > tr:nth-child(12) > td:nth-child(2) > input[type=radio]:nth-child(1)")
    khchszq_locator = (By.CSS_SELECTOR, "#customer_outdays")
    khlqzq_locator = (By.CSS_SELECTOR, "body > div.container > div.tabbable > div > form > table > tbody > tr:nth-child(14) > td:nth-child(2) > select")
    lqcs_locator = (By.CSS_SELECTOR, "#customer_limit_counts")
    xschszq_locator = (By.CSS_SELECTOR, "#leads_outdays")
    shezhi_baocun_locator = (By.CSS_SELECTOR, "body > div.container > div.tabbable > div > form > table > tbody > tr:nth-child(16) > td:nth-child(2) > input")

    def toux_click(self):
        self.driver.find_element(*self.toux_locator).click()

    def xtsz_click(self):
        self.driver.find_element(*self.xtsz_submit_locator).click()

    def httx_input(self, httx):
        self.driver.find_element(*self.httx_locator).clear()
        self.driver.find_element(*self.httx_locator).send_keys(httx)

    def htqz(self, htqz):
        self.driver.find_element(*self.htqz_locator).clear()
        self.driver.find_element(*self.htqz_locator).send_keys(htqz)

    def rwfp(self):
        self.driver.find_element(*self.rwfp_locator).click()

    def khchszq(self, khchszq):
        self.driver.find_element(*self.khchszq_locator).clear()
        self.driver.find_element(*self.khchszq_locator).send_keys(khchszq)

    def khlqzq_xz(self):
        khlqzq_select_element = self.driver.find_element(*self.khlqzq_locator)
        khlqzq_select = Select(khlqzq_select_element)
        khlqzq_select.select_by_index(1)

    def lqcs_input(self, lqcs):
        self.driver.find_element(*self.lqcs_locator).clear()
        self.driver.find_element(*self.lqcs_locator).send_keys(lqcs)

    def xschszq_input(self, xschszq):
        self.driver.find_element(*self.xschszq_locator).clear()
        self.driver.find_element(*self.xschszq_locator).send_keys(xschszq)

    def baocun_click(self):
        self.driver.find_element(*self.shezhi_baocun_locator).click()





















